Hi,
As a very simplified example, I have a model that contains the following
include "globals.mzn";
enum Days = {Mon, Tue, Wed, Thu, Fri, Sat, Sun};
set of int: Weeks = 1..3;
enum Activity = {Work, Free};
array[Weeks, Days] of var Activity: schedule;
constraint forall (w in Weeks) (
regular(schedule[w, ..], "Free* [^Free]+ Free*")
);
solve satisfy;
The gist is that for each week, the work is concentrated into one group. With 2.9.0, the IDE warns for the regular call, indicating ""Implicit coercion of enums to integers is deprecated and will be removed in a future version. Use the explicit coercion function enum2int instead"
Changing the constraint to
regular(enum2int(schedule[w, ..]), "Free* [^Free]+ Free*")
works as expected. However this _looks_ wrong as the regular expression is expressed over the enum variants.
Should I add the enum2int call in my regular-usages, or will there be a enum-variant of regular as well?
Cheers,
Mikael